<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>Découvrir Parangon-lang en 10 minutes</title>
		<link rel="stylesheet" type="text/css" href="http://shutterb.org/themes/default/style.css" id="shutterborg_stylesheet" />
	</head>

<body>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script>

$(document).ready(function() {
  function filterPath(string) {
  return string
    .replace(/^\//,'')
    .replace(/(index|default).[a-zA-Z]{3,4}$/,'')
    .replace(/\/$/,'');
  }
  var locationPath = filterPath(location.pathname);
  var scrollElem = scrollableElement('html', 'body');

  $('a[href*=#]').each(function() {
    var thisPath = filterPath(this.pathname) || locationPath;
    if (  locationPath == thisPath
    && (location.hostname == this.hostname || !this.hostname)
    && this.hash.replace(/#/,'') ) {
      var $target = $(this.hash), target = this.hash;
      if (target) {
        var targetOffset = $target.offset().top;
        $(this).click(function(event) {
          event.preventDefault();
          $(scrollElem).animate({scrollTop: targetOffset}, 400, function() {
            location.hash = target;
          });
        });
      }
    }
  });

  // use the first element that is "scrollable"
  function scrollableElement(els) {
    for (var i = 0, argLength = arguments.length; i <argLength; i++) {
      var el = arguments[i],
          $scrollElement = $(el);
      if ($scrollElement.scrollTop()> 0) {
        return el;
      } else {
        $scrollElement.scrollTop(1);
        var isScrollable = $scrollElement.scrollTop()> 0;
        $scrollElement.scrollTop(0);
        if (isScrollable) {
          return el;
        }
      }
    }
    return [];
  }

});

</script>

<style>
#navigation {
	opacity:0.1; 
	width: 200px ;
	list-style: none ;
	margin: 0 ;
	padding: 0 ;
	padding: 0;
	top: 0;
	z-index: 10;
	bottom: -20px;
	height: 160px;
	position: fixed;
	right: 0;
	}
	
#navigation li {
	color: #fff ;
	border: 1px solid #600 ;
	margin-bottom: 1px ;
	}
	
#navigation li a {
	display: block ;
	background: #000000 ;
	color: #fff ;
	line-height: 1em ;
	text-align: center ;
	text-decoration: none ;
	padding: 4px 0 ;
	}
	
#navigation li a:hover, #navigation li a:focus, #navigation li a:active {
	opacity:0.9; 
	background: #CDBFD9;
	text-decoration: none ;
	}

#navigation:hover{
	opacity:0.9; 
	}	

</style>

<ul id="navigation">
	<li><a href="#-1" title="Accueil">Accueil</a></li>
	<li><a href="#0" title="Remarques">Remarques</a></li>
	<li><a href="#1" title="Prérequis">Prérequis</a></li>
	<li><a href="#2" title="Présentation">Présentation</a></li>
	<li><a href="#3" title="Des applications puissantes">Des applications puissantes</a></li>
	<li><a href="#4" title="Premier pas">Premier pas</a></li>
	<li><a href="#5" title="Exemple avec une variable">Exemple avec une variable</a></li>
	<li><a href="#6" title="Des types simples">Des types simples</a></li>
	<li><a href="#7" title="Interaction avec l'utilisateur">Interaction avec l'utilisateur</a></li>
	<li><a href="#8" title="Fonctions mathématiques">Fonctions mathématiques</a></li>
	<li><a href="#9" title="Les conditions">Les conditions</a></li>
	<li><a href="#10" title="Les paragraphes et doublures">Les fonctions et paramètres</a></li>
	<li><a href="#11" title="Les blocs">Les blocs</a></li>
 	<li><a href="#12" title="Récursivité">La récursivité</a></li>
	<li><a href="#13" title="Les boucles">Les boucles</a></li>
	<li><a href="#14" title="Un peu de sucre ?">Un peu de sucre ?</a></li>
	<li><a href="#15" title="Attraper les erreurs">Attraper les erreurs</a></li>
	<li><a href="#16" title="Parallélisation des traitements">Parallélisation des traitements</a></li>
	<li><a href="#17" title="Les évènements">Les évènements</a></li>
	<li><a href="#18" title="Les prototypes">Les prototypes</a></li>
	<li><a href="#19" title="Le clonage">Le clonage</a></li>
</ul>

<div style="font-family: courier new,courier,mono,monospace,serif; 
text-align: center; background-color: rgb(240, 240, 240);" class="" 
id="-1"><span class="">********************************************</span><span
 class="author-g-1lz122zhencoqj72z122z0sy"></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
text-align: center; background-color: rgb(240, 240, 240);" class="" 
id="magicdomid3"><span class="">|&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 |</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
text-align: center; background-color: rgb(240, 240, 240);" class="" 
id="magicdomid4"><span class="">|&nbsp; Découvrir Parangon-Lang en dix 
minutes&nbsp; |</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
text-align: center; background-color: rgb(240, 240, 240);" class="" 
id="magicdomid5"><span class="">| &nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;


 |</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
text-align: center; background-color: rgb(240, 240, 240);" class="" 
id="magicdomid6"><span class="">********************************************<br>
</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid7"><br>
<br>
<br>
<div style="text-align: center;"><font size="2">Dix 
minutes pour découvrir les bases</font><br>
</div>
<br>
<br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(240, 240, 240);" class="" id="0"><font 
size="2"><span class="b"><strong>* <span style="text-decoration: 
underline;">Remarques</span></strong></span></font><span class="b"><strong></strong></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid9"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
text-align: justify;" class="ace-line" id="magicdomid352"><span class="">-
 Ce

 document présente
 rapidement </span><span class="author-g-4vbwdpt8cfwp18sl">quelques </span><span
 class="">fonctionnalités du langage Parangon-Lang.</span></div>
<div style="text-align: justify;">
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
text-align: justify;" class="" id="magicdomid11"><span class="">- Ce 
n'est pas un 
tutoriel pour 
apprendre à programmer.</span></div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">

</div>

<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid16"><br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(240, 240, 240);" class="" id="1"><span 
class="b"><strong>* </strong></span><span class="b u"><strong><span 
style="text-decoration: underline;">Prérequis</span></strong></span><span
 class="b"><strong></strong></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid18"><br>
</div>
- Avoir installé Parangon-Lang Studio :<br>
<div style="margin-left: 40px;"><a target="_blank" 
href="http://code.google.com/p/parangon-lang/">http://code.google.com/p/parangon-lang/</a><br>
<br>
</div>
<a name="2"><a>
<div style="background-color: rgb(240, 240, 240);" id="2"><span 
style="font-weight: bold;">* <span style="text-decoration: underline;">Présentation</span></span></div>
<br>
<div style="text-align: justify;">
Parangon-Lang est un langage de programmation très simple à prendre en main. 
Ces principales caractéristiques sont :<br>
</div>
<ul><li>programmation impérative (pour les débutants)</li>
	<li>programmation fonctionnelle (pour la programmation 
d'algorithmes)</li>
	<li>programmation orientée objet</li>
	<li>programmation orientée prototype</li>
	<li>programmation graphique et événementielle</li>
</ul>
<div style="background-color: rgb(240, 240, 240);" id="3"><span 
style="font-weight: bold;">* <span style="text-decoration: underline;">Des
 applications puissantes</span></span></div>
<br>
<div style="text-align: justify;">Malgré sa simplicité apparente, le 
langage peut produire des 
programmes complexes. Voici quelques réalisations :<br>
</div>
<ul>
	<li>..<a href=""></a></li>
</ul>
<br>
<div style="background-color: rgb(240, 240, 240);" id="4"><span 
style="font-family: courier new,courier,mono,monospace,serif; 
font-weight: bold;">* </span><span style="text-decoration: underline; 
font-family: courier new,courier,mono,monospace,serif; font-weight: 
bold;">Premier pas</span></div>
</div>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192); text-align: left;" class="" 
id="magicdomid37"><div style="margin-left: 40px;"><span>def Politesse</span><br>
<span><em></em></span></div>
<div style="margin-left: 40px;"><span class="i">fun main</span><br>
<span><em></em></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
begin</span><br>
<span><em></em></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; print 
"Bonjour !"</span><br>
<span><em></em></span></div>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid38"><span class="">&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid39"><span class="">En 4 lignes, nous avons écrit 
un premier programme qui peut 
être directement exécuté dans le Parangon-Lang Studio.<br>
</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid40"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(240, 240, 240);" class="" id="5"><span 
class="b"><strong>* </strong></span><span class="b u"><strong><span 
style="text-decoration: underline;">Exemple 
avec une 
variable</span></strong></span><span class="b"><strong></strong></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid42"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
text-align: justify;" class="" id="magicdomid43"><span class="">Une variable est caractérisée par un nom, un 
type et une valeur.<br>
</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid44"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid45"><span 
class="">&nbsp;&nbsp;&nbsp;<span style="font-style: italic;"> </span></span><span
 style="" class="i">def Variable&nbsp;</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid46"><span 
class="">&nbsp;&nbsp;&nbsp; fun main </span><span class="i">&nbsp;</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid48"><span 
class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i">&nbsp;&nbsp;&nbsp;<span
 style="color: rgb(240, 0, 0);"> prénom :: string := 
"Nicolas"</span></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid49"><span 
class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i">&nbsp;&nbsp;&nbsp;
 begin</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid50"><span 
class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 print "Bonjour, " + 
prénom</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid51"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
text-align: justify;" class="" id="magicdomid52"><span class="">La 
déclaration des variables est
 effectuée avant le bloc </span><span class="i">begin</span><span 
class="">.</span></div>
<div style="text-align: justify;">
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
text-align: justify;" class="" id="magicdomid54"><span class="">Cet 
exemple créé la variable </span><span class="i"><em>prénom</em></span><span
 class=""> typée </span><span class="i"><em>String</em></span><span 
class=""> et contiendra la valeur 
"Nicolas".</span></div>
<div style="text-align: justify;">

</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
text-align: justify;" class="" id="magicdomid56"><span class="">Si vous 
l'essayez dans 
le studio, vous obtiendrez sur la console : </span><span class="i"><em><br>
Bonjour,
 Nicolas</em></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid57"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(240, 240, 240);" class="" id="6"><span 
class="b"><strong>* </strong></span><span class="b u"><strong><span 
style="text-decoration: underline;">Des types simples</span></strong></span><span
 class="b"></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid59"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid60"><span class="">Le langage propose seulement 5
 types qui sont :</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid61"><span class="i"><em>string</em></span><span 
class="">, </span><span class="i"><em>number</em></span><span class="">,
 </span><span class="i"><em>boolean</em></span><span class="">, </span><span
 class="i"><em>array</em></span><span class="">, </span><span class="i"><em>prototype<br>
<br>
</em></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid62"><span class="">Nous verrons à travers les 
exemples comment les utiliser.</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid63"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(240, 240, 240);" class="" id="7"><span 
class="b"><strong>* </strong></span><span class="b u"><strong><span 
style="text-decoration: underline;">Interaction


 avec 
l'utilisateur</span></strong></span><span class="b"><strong></strong></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid65"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid66"><span class="">La commande </span><span 
class="b"><strong>INPUT </strong>interroge </span><span class="">l'utilisateur


 :</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid67"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid68"><span 
class="">&nbsp;&nbsp;&nbsp;<span style="font-style: italic;"> </span></span><span
 style="" class="i">def Exemple de la commande INPUT <br>
</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid69"><div 
style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid69"><span 
class="">&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 160, 0);">/*Ceci 
est un commentaire !*/</span></span><span class="i"></span></div>
<span class="">&nbsp;&nbsp;&nbsp; fun main </span><span class="i">&nbsp;</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid71"><span 
class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i">&nbsp;&nbsp;&nbsp;&nbsp;
 prénom :: string&nbsp;</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid72"><span 
class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i">&nbsp;&nbsp;&nbsp;&nbsp;
 begin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid73"><span 
class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

 print "Quel est ton prénom ?"</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid74"><span 
class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 </span><span style="color: rgb(240, 0, 0);" class="b i"><strong>input
 </strong></span><span class="i">prénom</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid75"><span 
class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

 print "Bonjour, " + prénom</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid76"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid87"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(240, 240, 240);" class="" id="8"><span 
class="b"><strong>* </strong></span><span class="b u"><strong><span 
style="text-decoration: underline;">Fonctions
 mathématiques</span></strong></span><span class="b"><strong></strong></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid89"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid90"><span class="">Les fonctions disponibles sont
 :</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid92">
<ul class="list-bullet2">
	<li><span class="">Cosinus



 : cos x<br>
</span></li>
	<li><span class="">Sinus


 : sin x<br>
</span></li>
	<li><span class="">Fonction



 exponentielle : exp x<br>
</span></li>
	<li><span class="">Logarithme



 décimal: log x<br>
</span></li>
	<li><span class="">Logarithme


 naturel: logn x<br>
</span></li>
	<li><span class="">Valeur



 absolue : abs x<br>
</span></li>
	<li><span class="">Racine


 carrée : sqr x<br>
</span></li>
	<li><span class="">Partie entière
 : floor x<br>
</span></li>
	
   <li><span class="">Arrondi
 : round x<br>
</span></li>
   
	<li><span class="">Puissance


 : x pow n<br>
</span></li>
	<li><span class="">Modulo



 : x mod n<br>
</span></li>
	<li><span class="">Et


 logique : x and n<br>
</span></li>
	<li><span class="">Ou



 logique : x or n<br>
</span></li>
	<li><span class="">Xou


 logique : x xor n<br>
</span></li>
	<li><span class="">Tangente



 : tan x<br>
</span></li>
	<li><span class="">Arc


 cosinus : acos x<br>
</span></li>
	<li><span class="">Arc



 sin : asin x<br>
</span></li>
	<li><span class="">Arc


 tangente : atan x<br>
</span></li>
	<li><span class="">Hasard


 : 
random x<br>
</span></li>
<li><span class="">Non
 :
not x<br>
</span></li>
<li><span class="">Fonction ternaire
 :
ter (b,x,y)<br>
</span></li>
</ul>
Exemple simple :<br>
<br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid124"><span
 class="">&nbsp;&nbsp;&nbsp; </span><span class="i">def Exemple mathématique
 &nbsp;</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid125"><span
 class="">&nbsp;&nbsp;&nbsp; fun main</span><span class="i">&nbsp;</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid126"><span
 class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
begin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid127"><span
 class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i"><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 </em></span><span class="b i"><strong>print sqr 4</strong></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid128"><span
 class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i"><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 </em></span><span class="b i"><strong>print 2 pow 3</strong></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid129"><span
 class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i"><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 </em></span><span class="b i"><strong>print ter(false,"non","oui")</strong></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid130"><span
 style="font-style: italic;" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 </span><span class="b i"><strong><span style="">print true or false</span><br>
</strong></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid132"><br>
Exemple plus complexe :<br>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid130"><div 
style="margin-left: 40px;"><span class=""></span>def Syracuse<br>
</div>
<div style="margin-left: 40px;">
fun main<br>
&nbsp;&nbsp;&nbsp; durée :: number := 0<br>
&nbsp;&nbsp;&nbsp; e :: number<br>
&nbsp;&nbsp;&nbsp; begin<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; input e<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while e != 1 : {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; durée = 
durée + 1<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (e mod 2) ==
 0 : e = e / 2<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else e = e
 * 3 + 1<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print durée<br>
</div>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid131"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(240, 240, 240);" class="" id="9"><span
 class="b"><strong>* </strong></span><span class="b u"><strong><span 
style="text-decoration: underline;">Les 
conditions</span></strong></span><span class="b"><strong></strong></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid136"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid137"><span class="">Le langage propose les 
conditions suivantes :</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid139"><ul class="list-bullet1"><li><span class="">if













 ? == ? :</span></li>
	<li><span class="">if


 ? != ? :</span></li>
	<li><span class="">if



 ? &gt; ? :</span></li>
	<li><span class="">if


 ? &lt; ? :</span></li>
	<li><span class="">if



 ? &gt;= ? :</span></li>
	<li><span class="">if


 ? &lt;= ? :</span></li>
	<li><span class="">if


 ? intersect ? 
: ? (à utiliser avec des objets graphiques)<br>
</span></li>
	<li><span class="">if


 ? : ?</span></li>	
</ul>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid153"><span class="">Les conditions peuvent 
s'utiliser simplement sur une ligne :</span></div>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid159"><div 
style="margin-left: 40px;"><span class="i">def Exemple conditions</span><br>
<span class="i"></span></div>
<div style="margin-left: 40px;"><span class="i">fun main</span><br>
<span class="i"></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
begin</span><br>
<span class="i"></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; if (2 * 2) 
== (2
 + 2)
 : print "j'ai raison."</span><br>
<span class="i"></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; if (3 * 3) 

&gt; 

(3 + 3) : print "j'ai toujours raison !"</span><br>
<span class="i"><em></em></span></div>
<span class="i"><em></em></span></div>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid161"><span class="">On peut utiliser des </span><span
 class="i"><em>blocs</em></span><span class=""> (*) :</span></div>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid171"><div 
style="margin-left: 40px;"><span class="b">def exemple

 conditions 2</span><br>
<span class="b"><strong></strong></span></div>
<div style="margin-left: 40px;"><span>fun main</span><br>
<span class="b"><strong></strong></span></div>
<div style="margin-left: 40px;"><span>&nbsp;&nbsp;&nbsp;

 begin</span><br>
<span class="b"><strong></strong></span></div>
<div style="margin-left: 40px;"><span class="b"><strong>&nbsp;&nbsp;&nbsp;


 &nbsp;&nbsp;&nbsp; if (2 * 2) == (2 + 2) : <span style="color: 
rgb(240, 0, 0);">{</span></strong></span><br>
<span class="b"><strong></strong></span></div>
<div style="margin-left: 40px;"><span>&nbsp;&nbsp;&nbsp;


 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print&nbsp; "j'ai 
raison"</span><br>
<span class="b"><strong></strong></span></div>
<div style="margin-left: 40px;"><span class="b"><strong>&nbsp;&nbsp;&nbsp;



 &nbsp;&nbsp;&nbsp; <span style="color: rgb(240, 0, 0);">}</span></strong></span><br>
<span class="b"><strong></strong></span></div>
<div style="margin-left: 40px;"><span class="b"><strong>&nbsp;&nbsp;&nbsp;










 &nbsp;&nbsp;&nbsp; if (3 * 3)&nbsp; &gt; (3
 + 3) : <span style="color: rgb(240, 0, 0);">{</span></strong></span><br>
<span class="b"><strong></strong></span></div>
<div style="margin-left: 40px;"><span>&nbsp;&nbsp;&nbsp;

 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print "j'ai toujours raison !"</span><br>
<span class="b"><strong></strong></span></div>
<div style="margin-left: 40px;"><span class="b"><strong>&nbsp;&nbsp;&nbsp;

 &nbsp;&nbsp;&nbsp; <span style="color: rgb(240, 0, 0);">}</span></strong></span><br>
<span class="b"><strong></strong></span></div>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid172"><span class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid173"><span class="">La clause </span><span 
class="i"><em>else </em></span><span class="">peut également être 
utilisée
 :</span></div>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid181"><div 
style="margin-left: 40px;"><span class="i">def Exemple conditions</span><br>
<span class="i"></span></div>
<div style="margin-left: 40px;"><span class="i">fun main</span><br>
<span class="i"></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
begin</span><br>
<span class="i"></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; if (2 * 2) 
== (2
 + 2) : {</span><br>
<span class="i"></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print 
"j'ai raison"</span><br>
<span class="i"></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; }</span><br>
<span class="i"></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; <span style="font-weight: bold; color: rgb(240, 0, 
0);">else</span> print 
"j'ai tort !"</span><br>
<span class="i"></span></div>
<span class="i"></span></div>
<span class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(240, 240, 240);" class="" id="10"><span
 class="b"><strong>* </strong></span><span class="b u"><strong><span 
style="text-decoration: underline;">Les 
fonctions et paramètres<br>
</span></strong></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid187"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid188"><span class="">Un programme en Parangon-Lang est 
constitué d'au minimum une 
fonction (par convention, on nomme la première fonction "main") :</span></div>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid196"><div 
style="margin-left: 40px;"><span class="b i"><strong><span 
style="font-weight: normal;">def exemple fonction simple</span></strong></span><br
 style="font-weight: normal;"><span class="b i"><strong><em></em></strong></span></div>
<div style="margin-left: 40px;"><span class="b i"><strong><span 
style="font-weight: normal;">fun main</span></strong></span><br 
style="font-weight: normal;"><span class="b i"><strong></strong></span></div>
<div style="margin-left: 40px;"><br
 style="font-weight: normal;"><span class="b i"><strong></strong></span></div>
<div style="margin-left: 40px;"><span class="b i"><strong><span 
style="font-weight: normal;">&nbsp;&nbsp;&nbsp; 
prénom 1 :: string</span></strong></span><br style="font-weight: normal;"><span
 class="b i"><strong></strong></span></div>
<div style="margin-left: 40px;"><span class="b i"><strong><span 
style="font-weight: normal;">&nbsp;&nbsp;&nbsp; begin</span></strong></span><br
 style="font-weight: normal;"><span class="b i"><strong><em></em></strong></span></div>
<div style="margin-left: 40px;"><span class="b i"><strong><span 
style="font-weight: normal;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
input prénom 1</span></strong></span><br style="font-weight: normal;"><span
 class="b i"><strong><em></em></strong></span></div>
<div style="margin-left: 40px;"><span class="b i"><strong><span 
style="font-weight: normal;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
print "bonjour, " + prénom 1 + " 
!"</span></strong></span><br>
<span class="b i"><strong></strong></span></div>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid197"><span class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid198"><span class="">Il est parfois utile de 
découper un algorithme en plusieurs fonctions :</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid199"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid222"><div 
style="margin-left: 40px;"><span class="">def Exemple
 Paragraphe 2</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">fun main</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class=""> 
&nbsp;&nbsp;&nbsp; Note1 :: number</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class=""> 
&nbsp;&nbsp;&nbsp; Note2 :: number</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">
 &nbsp;&nbsp;&nbsp; Note3 :: number</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">&nbsp;&nbsp;&nbsp; 
begin</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp; call question, "Pierre", note1</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; call question, "Jacques", note2</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; call question, "Hugo", note3</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; print "La note 
de 
Pierre est " + note1</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; print "La note 
de 
Jacques est " + note2</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; print "La note 
de 
Hugo est " + note3</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><br>
</div>
<div style="margin-left: 40px;"><span class="">fun question </span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class=""> 
&nbsp;&nbsp;&nbsp; <span style="color: rgb(240, 0, 0);">*</span>

 prénom :: string</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class=""> 
&nbsp;&nbsp;&nbsp; <span style="color: rgb(240, 0, 0);">*</span> valeur 
:: number</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">&nbsp;&nbsp;&nbsp; 
begin</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp; print "Quelle est la note de " + prénom</span> + "
 ?"<br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp; input valeur</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; return</span></div>
</div>
<br>
<div style="text-align: justify;"><span style="font-family: courier 
new,courier,mono,monospace,serif;">Il 
suffit de préfixer une variable d'un astérisque (<span style="color: 
rgb(240, 0, 0);">*</span>) et celle-ci devient un paramètre.</span><br>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
text-align: justify;" class="" id="magicdomid198"><span class="">--&gt; 
Une fonction peut <span 
style="text-decoration: underline;">retourner</span> une valeur :<br>
</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid199"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid222"><div 
style="margin-left: 40px;"><span class="">def Exemple











 fonction 3</span><br>
fun main<br>
&nbsp;&nbsp;&nbsp; begin<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print "La note de Pierre est " +
 <span style="color: rgb(240, 0, 0);">question(</span>"Pierre"<span 
style="color: rgb(240, 0, 0);">)</span><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print "La note de Jacques est " +
 <span style="color: rgb(240, 0, 0);">question(</span>"Jacques"<span 
style="color: rgb(240, 0, 0);">)</span><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print "La note de Hugo est " + <span
 style="color: rgb(240, 0, 0);">question(</span>"Hugo"<span 
style="color: rgb(240, 0, 0);">)</span><br>
<br>
fun question<br>
&nbsp;&nbsp;&nbsp; <span style="color: rgb(240, 0, 
0);">*</span> prénom :: string<br>
&nbsp;&nbsp;&nbsp; valeur :: number<br>
&nbsp;&nbsp;&nbsp; begin<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print "Quelle est 
la note de " + prénom + " ?"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; input valeur<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: rgb(240, 0, 
0);">return </span>valeur</div>
</div>
<br>
</div>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(240, 240, 240);" class="" id="11"><span
 class="b"><strong>* </strong></span><span class="b u"><strong><span 
style="text-decoration: underline;">Les 
blocs<br>
</span></strong></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid225"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
text-align: justify;" class="" id="magicdomid226"><span class="">Les 
blocs sont des
 structures internes à une 
fonction. On peut les utiliser dans des conditions ou les boucles.</span></div>
<div style="text-align: justify;">
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
text-align: justify;" class="" id="magicdomid227"><span class="">Un 
bloc débute par le symbole </span><span class="i"><em>{</em></span><span class="">

 
et termine par </span><span class="i"><em>}</em></span><span
 class="">.</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid228"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid243"><div 
style="margin-left: 40px;"><span class=""><span style=""></span></span><span
 class="i">def Exemple sur les 
blocs</span><br>
<span class="i"></span></div>
<div style="margin-left: 40px;"><span class="i">fun main</span><br>
<span class="i"><em></em></span></div>
<div style="margin-left: 40px;"><span class="i"> 
&nbsp;&nbsp;&nbsp; âge :: 
number</span><br>
<span class="i"><em></em></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
begin</span><br>
<span class="i"><em></em></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; print 
"Quel est&nbsp; ton âge ?"</span><br>
<span class="i"></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; input âge</span><br>
<span class="i"></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; if âge &lt; 
10 
: <span style="color: rgb(240, 0, 0);">{</span></span><br>
<span class="i"><em></em></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print 
"Tu es bien jeune pour programmer !"</span><br>
<span class="i"><em></em></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print 
"Mais tu es plein de promesses !"</span><br>
<span class="i"><em></em></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; <span style="color: rgb(240, 0, 0);">}</span></span><br>
<span class="i"><em></em></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; else if 
âge &lt; 15 : <span style="color: rgb(240, 0, 0);">{</span></span><br>
<span class="i"><em></em></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print 
"Tu iras loin à programmer en langage 
Parangon-Lang !"</span><br>
<span class="i"><em></em></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print 
"Ton 
avenir sera riche !"</span><br>
<span class="i"><em></em></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; <span style="color: rgb(240, 0, 0);">}</span></span><br>
<span class="i"><em></em></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; else 
print "Tu fais bien plus jeune que tes "&nbsp;
 + âge + " années !"</span><br>
<span class="i"><em></em></span></div>
<span class="i"><em></em></span></div>
<br>

<div style="font-family: courier new,courier,mono,monospace,serif;" class="" ><br />
<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(240, 240, 240);" class="" id="12"><span class="b"><strong>*
 </strong></span><span class="b u"><strong><span style="text-decoration: underline;">La récursivité<br />
</span></strong></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" class="" id="magicdomid246"><br />
</div>
  <div style="font-family: courier new,courier,mono,monospace,serif; text-align: justify;" class="" id="magicdomid247"><span class="author-g-1lz122zhencoqj72z122z0sy">Implémenter des algorithmes récursifs en Parangon-Lang est possible. Le meilleur exemple... la suite de Fibonacci :<br />
</span></div>
<div style="text-align: justify;">
</div>
<div style="font-family: courier new,courier,mono,monospace,serif;" class="" id="magicdomid248">
<span class="author-g-1lz122zhencoqj72z122z0sy">

<br />
</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(192, 192, 192);" class="" id="magicdomid264"><div style="margin-left: 40px;"><span class="author-g-1lz122zhencoqj72z122z0sy">def Fibonacci<br />
fun main<br />
&nbsp;&nbsp;&nbsp; n :: number<br />
&nbsp;&nbsp;&nbsp; begin<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print "Entrez un nombre :"<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; input n <br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print fibo(n)<br />
<br />
fun fibo<br />
&nbsp;&nbsp;&nbsp; * n :: number<br />
&nbsp;&nbsp;&nbsp; begin<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if n &lt; 2 : return n<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else return fibo(n-1) + fibo(n-2)</span><br />
<span class="author-g-1lz122zhencoqj72z122z0sy"></span></div>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif;" class="" id="magicdomid265"><span class="author-g-1lz122zhencoqj72z122z0sy">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
<span class="author-g-1lz122zhencoqj72z122z0sy"></span><br />
</div>

<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(240, 240, 240);" class="" id="13"><span
 class="b"><strong>* </strong></span><span class="b u"><strong><span 
style="text-decoration: underline;">Les 
boucles<br>
</span></strong></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid296"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid297"><div style="font-family: courier 
new,courier,mono,monospace,serif; text-align: justify;" class="" 
id="magicdomid198"><span class="">Les boucles, briques essentielles lors
 de l'élaboration 
d'algorithme sont présentes sous différentes formes dans le langage 
Parangon-Lang.<br>
<br>
La forme la plus usuelle est "for n, a to b ... " :<br>
</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid199"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid222"><div 
style="margin-left: 40px;">def Exemple de boucle<br>
</div>
<div style="margin-left: 40px;"><span class="">fun main<br>
&nbsp;&nbsp;&nbsp; Notes :: number ..<br>
&nbsp;&nbsp;&nbsp; Prénoms :: string .. "Pierre", "Jacques", "Hugo"<br>
&nbsp;&nbsp;&nbsp; b :: number<br>
&nbsp;&nbsp;&nbsp; begin<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: rgb(240, 0, 
0);">for b, 0 to 2</span> : {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; note :: 
number<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; call 
question, prénoms[b], note<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; add note, notes<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: rgb(240, 0, 
  0);">for b, 0 to 2</span>: {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print "La 
note de " + prénoms[b] + " est " + notes[b]<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
<br>
fun question<br>
&nbsp;&nbsp;&nbsp; * prénom :: string<br>
&nbsp;&nbsp;&nbsp; * valeur :: number<br>
&nbsp;&nbsp;&nbsp; begin<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print "Quelle est la note de " +
 prénom + " ?"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; input valeur<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return<br>
</span></div>
</div>
</div>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid198"><span class="">La forme "while<span 
style="font-style: italic;"> condition</span> ... " est également 
disponible :<br>
</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid199"><br>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid222">
    <div style="margin-left: 40px;">def Exemple de boucle<br>
</div>
<div style="margin-left: 40px;">fun main<span class=""><br>
&nbsp;&nbsp;&nbsp; Notes :: number ..<br>
&nbsp;&nbsp;&nbsp; Prénoms :: string ..  
"Pierre", "Jacques", "Hugo"<br>
&nbsp;&nbsp;&nbsp; b :: number := 0<br>
&nbsp;&nbsp;&nbsp; begin<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: rgb(240, 0, 
0);">while b &lt; 3</span> : 
{<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; note :: 
number<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; call 
question, prénoms [b], note<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; add note, notes<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; b = b + 1<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: rgb(240, 0, 
0);">while b &gt; 0</span> : 
{<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; b = b - 1<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print "La 
note de " + prénoms[b] + " est " + notes[b]<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
<br>
fun question<br>
&nbsp;&nbsp;&nbsp; * prénom :: string<br>
&nbsp;&nbsp;&nbsp; * valeur :: number<br>
&nbsp;&nbsp;&nbsp; begin<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print "Quelle est la note de " +
 prénom + " ?"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; input valeur<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return</span><br>
</div>
</div>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(240, 240, 240);" class="" id="14"><span
 class="b"><strong>* <span style="text-decoration: underline;">Un peu de
 </span></strong></span><span class="b u"><strong><span 
style="text-decoration: underline;">sucre ?<br>
</span></strong></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid310"><br>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid173"><span class=""></span><span class="">Quelques









 raccourcis très utiles sont proposés.</span><br>
</div>
<br>
- Raccourci pour la commande <span style="font-style: italic;">PRINT </span>:<br>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid181"><div 
style="margin-left: 40px;"><span class="i">def Sucrerie 1</span><br>
<span class="i"><em></em></span></div>
<div style="margin-left: 40px;"><span class="i">fun main</span><br>
<span class="i"><em></em></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
begin</span><br>
<span class="i"><em></em></span></div>
<div style="margin-left: 40px;"><span class="i">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; </span>"Bonjour








 " <span style="color: rgb(240, 0, 0);">!</span><br>
<span class="i"><em></em></span></div>
<span class="i"><em></em></span></div>
<span class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 </span><br>
- Raccourci pour la commande <span style="font-style: italic;">INPUT</span>
 :<br>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid79"><span 
class="">&nbsp;&nbsp;&nbsp; </span><span class="i">def Sucrerie </span>2<span
 class="i"></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid80"><span 
class="">&nbsp;&nbsp;&nbsp; fun main</span><span class="i"></span></div>

<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid82"><span 
class="">&nbsp;&nbsp;</span><span class="i">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prénom
 :: string&nbsp;</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid83"><span 
class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 begin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid84"><span 
class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
 style="color: rgb(240, 0, 0);"></span></span><span style="color: 
rgb(240, 0, 0);" class="b i"><strong><em></em></strong></span><span 
class="i"> "Quel
 est ton prénom ?" <span style="color: rgb(0, 0, 0);">!</span><br>
</span><div style="margin-left: 80px;">&nbsp;Prénom <span style="color: 
rgb(240, 0, 0);">?</span><br>
</div>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid85">&nbsp;&nbsp;&nbsp;&nbsp;<span
 class="i">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Bonjour, " + 
prénom <span style="color: rgb(0, 0, 0);">!</span><br>
</span></div>
<!-- ajout interpolation de chaine -->
<div style="font-family: courier new,courier,mono,monospace,serif;" class="" id="magicdomid86"><br />
- Interpolation de chaîne :<br />
<br />
<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(192, 192, 192);" class="" id="magicdomid79"><span class="">&nbsp;&nbsp;&nbsp; </span><span class="i">def Sucrerie </span>4 <br />
</div>
<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(192, 192, 192);" class="" id="magicdomid80"><div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(192, 192, 192);" class="" id="magicdomid80"></span><span style="color: rgb(0, 160, 0);" class="i"></span></div>
<span class=""></span><span class="">&nbsp;&nbsp;&nbsp; fun main </span><span class="i"></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(192, 192, 192);" class="" id="magicdomid82"><span class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prénom
 :: string&nbsp;:= "Amandine"</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(192, 192, 192);" class="" id="magicdomid83"><span class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 begin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(192, 192, 192);" class="" id="magicdomid84"><span class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span><span class="i">print </span>"Le prénom est ${prénom}"<span class="">&nbsp;&nbsp;&nbsp;&nbsp;</span>
</div>
<br />
</div>
<!-- fin ajout -->
- Regrouper plusieurs actions identiques en une ligne :<br>
<br>
Au lieu d'écrire :<br>
</div>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid79"><div 
style="margin-left: 40px;"><span class=""></span><span class="i">def Sucrerie&nbsp;</span>5<br>
</div>
<div style="margin-left: 40px;"><span class="">fun main</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class=""> 
&nbsp;&nbsp; &nbsp;nom :: string</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class=""> 
&nbsp;&nbsp; &nbsp;prénom :: string</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">&nbsp;&nbsp;&nbsp; 
begin</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp; &nbsp;nom <span style="color: rgb(0, 0, 0);">?</span></span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp; &nbsp;prénom <span style="color: rgb(0, 0, 0);">?</span></span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp; &nbsp;nom <span style="color: rgb(0, 0, 0);">!</span></span><br>
<span class=""></span></div>
<div style="margin-left: 40px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; 
&nbsp;prénom <span style="color: rgb(0, 0, 0);">!</span><br>
<span class=""></span></div>
</div>
<span class=""></span><span style="font-family: courier 
new,courier,mono,monospace,serif;" class="i"><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 </em></span><br style="font-family: courier 
new,courier,mono,monospace,serif;"><span style="font-family: courier 
new,courier,mono,monospace,serif;">L'utilisation

 de l'esperluette contracte le programme ainsi :</span><br>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid79">
  <div style="margin-left: 40px;"><span class=""></span>def Sucrerie&nbsp;</span><span 
style="font-style: italic;" class="">6</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">fun main</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">&nbsp;&nbsp;&nbsp; 
nom <span style="color: rgb(240, 0, 0);">&amp;</span>
 prénom :: string</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">&nbsp;&nbsp;&nbsp; 
begin</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp; &nbsp;nom <span style="color: rgb(240, 0, 0);">&amp;</span>
 prénom ?</span><br>
<span class=""></span></div>
<div style="margin-left: 40px;"><span class="">&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; prénom <span style="color: rgb(240, 0, 0);">&amp;</span>
 nom !</span><br>
</div>
<div style="margin-left: 40px;">
    <span class=""></span></div>
</div>
<span class=""></span><span class="i"><em></em></span><div 
style="font-family: courier new,courier,mono,monospace,serif;" class="" 
id="magicdomid316"><br>
- Regrouper plusieurs commandes différentes en une ligne :<br>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid79"><div 
style="margin-left: 40px;"><span class=""></span><span class="i">def Sucrerie&nbsp;</span><span
 class=""><span style=""></span></span><span style="">7</span><br>
fun main<br>
&nbsp;&nbsp;&nbsp; nom &amp; prénom :: string<br>
&nbsp;&nbsp;&nbsp; begin<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; input nom <span 
style="color: rgb(240, 0, 0);">;</span> 

print nom<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; input prénom <span style="color:
 rgb(240, 0, 0);">;</span> 

print prénom<br>
</div>
</div>
</div>
<br>
<span style="font-family: courier new,courier,mono,monospace,serif;">- A
 l'inverse, il est possible de découper une ligne !</span><br>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid79"><div 
style="margin-left: 40px;"><span class=""></span><span class="i">def Sucrerie


 </span><span class=""><span style="">8</span></span>
<br>
fun main<br>
&nbsp;&nbsp;&nbsp; <span class="">Prénoms :: 
string .. "Pierre", 
"Jacques", 
"Hugo", <span style="color: rgb(240, 0, 0);">...</span><br>
</span><div style="margin-left: 120px;">"Paul", "Nicolas"<br>
</div>
&nbsp;&nbsp;&nbsp; begin<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for prénoms : print <span
 style="color: rgb(240, 0, 0);">joker</span><br>
</div>
</div>
<br>
<div style="text-align: justify;"><span style="font-family: courier 
new,courier,mono,monospace,serif;">Le <span style="color: rgb(240, 0, 
0);">joker</span> est une variable particulière 
car celle-ci est alimentée par Parangon-Lang dés que l'on utilise la forme 
simple des boucles : "for X :".</span><br>
<span style="font-family: courier new,courier,mono,monospace,serif;">Dans

 cet exemple, à chaque itération, elle prend une valeur 
successive du tableau "prénoms".</span><br>
</div>
<br>

<!-- ajout inférence des types -->
<div style="font-family: courier new,courier,mono,monospace,serif;" class="" id="magicdomid86"><br />
- Inférence de types simples :<br />
<br />
<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(192, 192, 192);" class="" id="magicdomid79"><span class="">&nbsp;&nbsp;&nbsp; </span><span class="i">def Sucrerie </span>9 <br /></div>

<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(192, 192, 192);" class="" id="magicdomid80"><div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(192, 192, 192);" class="" id="magicdomid80"><span style="color: rgb(0, 160, 0);" class="i"></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(192, 192, 192);" class="" id="magicdomid80"><div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(192, 192, 192);" class="" id="magicdomid80"><span class="">&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 160, 0);">/*Pour les types <i>number</i> ou <i>string</i>, Parangon-Lang peut déterminer automatiquement le type :*/</span></span><span style="color: rgb(0, 160, 0);" class="i"></span></div>
<span class=""></span><span class="">&nbsp;&nbsp;&nbsp; fun main</span><span class="i"></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(192, 192, 192);" class="" id="magicdomid81"></div>
<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(192, 192, 192);" class="" id="magicdomid82"><span class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prénom&nbsp;:= "Amandine"</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(192, 192, 192);" class="" id="magicdomid82"><span class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;âge&nbsp;:= 1</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(192, 192, 192);" class="" id="magicdomid83"><span class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 begin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(192, 192, 192);" class="" id="magicdomid84"><span class="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="i">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span><span class="i">print </span>"${prénom} a ${âge} an !!"<span class="">&nbsp;&nbsp;&nbsp;&nbsp;</span>
</div>
<br />
</div>
<!-- fin ajout -->

<br />
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(240, 240, 240);" class="" id="15"><span
 class="b"><strong>* <span style="text-decoration: underline;">Attraper 
les erreurs</span></strong></span><span class="b u"><strong><span 
style="text-decoration: underline;"><br>
</span></strong></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid310"><br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
text-align: justify;" class="" id="magicdomid173">Nous sommes tous un 
peu des têtes de 
Linotte... Une erreur est vite arrivée dans l'élaboration d'un 
algorithme. Pour s'en protéger, et surtout, pour mieux comprendre 
l'origine du problème, on entoure son algorithme d'un bloc <span 
style="font-style: italic;">Try. </span>C<span style="font-style: 
italic;"></span>elui-ci permet au développeur de procéder à 
son
 l'analyse et à sa correction :<br>
</div>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid181"><div 
style="margin-left: 40px;"><span class="i"><em></em></span>def Algorithme 
farfelu<br>
<span class="i"><em></em></span></div>
<div style="margin-left: 40px;">fun main<br>
&nbsp;&nbsp;&nbsp; valeur :: number := 10<br>
&nbsp;&nbsp;&nbsp; begin<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: rgb(240, 0, 
0);">try</span> : {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while valeur
 &gt; 0 : {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; valeur temporaire :: number := valeur - 1<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; if (valeur / valeur temporaire) &gt; 0 : {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print "Je peux continuer"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; valeur = valeur&nbsp; - 1<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; else valeur = valeur - 2<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: rgb(240, 0, 
0);">else</span> print 
"Pfff, une erreur dans ton algorithme lorsque valeur = " ...<br>
<div style="margin-left: 80px;">+ valeur<br>
</div>
</div>
</div>
</div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid327"><br>
<div style="text-align: justify;">
Et si l'erreur est vraiment insaisissable, utilisons les grands moyens :
 le débogage.<br>
</div>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid181">
<div style="margin-left: 40px;">def Algorithme farfelu<br>
fun main<br>
&nbsp;&nbsp;&nbsp; valeur :: number := 10<br>
&nbsp;&nbsp;&nbsp; begin<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: rgb(240, 0, 
0);">debug</span><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while valeur &gt; 0 : {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; valeur 
temporaire :: nombre := valeur - 1<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (valeur / 
valeur temporaire) &gt; 0 : {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; print "Je peux continuer"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; valeur = valeur&nbsp; - 1<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else valeur 
= valeur - 2<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
</div>
</div>
On avance dans l'algorithme en cliquant sur le bouton "Pas à pas" du Parangon-Lang Studio.<br>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(240, 240, 240);" class="" id="16"><span
 class="b"><strong>* <span style="text-decoration: underline; 
font-weight: bold;"></span></strong></span><span style="text-decoration:
 underline; font-weight: bold;" class="b u">Parallélisation des traitements</span><span class="b u"><strong><span 
style="text-decoration: underline;">

</span></strong></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid310"><br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
text-align: justify;" class="" id="magicdomid173">Parangon-Lang est une tête 
bien faite ! Ce n'est pas une tâche mais plusieurs qu'il est capable 
de traiter en 
même temps !<br>
Pas besoin de longues explications car c'est très simple à mettre en 
place. <br>
Au lieu d'utiliser la commande <span style="font-style: italic;">CALL</span>,
 on utilise la commande <span style="font-style: italic;">LAUNCH</span> :<br>
</div>
<br>
<div style="font-family: courier new,courier,mono,monospace,serif; 
background-color: rgb(192, 192, 192);" class="" id="magicdomid181"><div 
style="margin-left: 40px;"><span class="i"><em></em></span>def sleep sort<br>
fun main<br>
&nbsp;&nbsp;&nbsp; paramètres :: number .. 
 7, 1, 3, 2, 5, 6, 4, 0, 3<br>
&nbsp;&nbsp;&nbsp; begin<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for paramètres : <span 
style="color: rgb(240, 0, 0);">launch
 </span>sleep, joker<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: rgb(240, 0, 
0);">wait </span>sleep<br>
<br>
fun sleep<br>
&nbsp;&nbsp;&nbsp; * élément :: number<br>
&nbsp;&nbsp;&nbsp; begin<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sleep élément * 1000<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print élément<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return<br>
<span class="i"><em></em></span></div>
<span class="i"><em></em></span></div>
<span class=""></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" 
class="" id="magicdomid321"><span class="">
</span><br>
<div style="text-align: justify;">
La commande <span style="font-style: italic;">WAIT </span>attend que 
toutes les tâches "sleep" soient terminées.<br>
</div>
</div>
<br />
<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(240, 240, 240);" class="" id="17"><font size="2"><span class="b"><strong>* <span style="text-decoration: underline;">Les évènements</span></strong></span></font><span class="b"><strong></strong></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" class="" id="magicdomid9"><br />
</div>
<div style="text-align: justify;"><div style="text-align: left;"><div style="text-align: justify;"><span class=""></span><span class="">L'interaction avec les éléments graphiques est facilitée par l'association d'un traitement à une action effectuée par l'utilisateur.</span><br />
</div>
<span class=""></span></div>
<span class=""><br />
Dans l'exemple suivant, une action sera exécutée à la fin d'un <span style="font-style: italic;">glisser-déposer</span> sur un des deux objets <span style="font-style: italic;">centre</span> ou <span style="font-style: italic;">boule</span> :<br />
</span><br />
<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(192, 192, 192);" class="" id="magicdomid50"><span class="i"><em></em></span>
  <div style="margin-left: 40px; text-align: left;">def Collision<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; centre :: circle,&nbsp; x = 311, y = 285, ...<br />
<div style="margin-left: 80px;">color = "255 0 0", full = true, rayon = 50<br />
</div>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; boule :: rectangle,&nbsp; width = 40, ...<br />
<div style="margin-left: 80px;">height = 20, color = "0 0 0", full = true<br />
</div>
<br />
fun main<br />
&nbsp;&nbsp;&nbsp; salle :: screen, color = "255 255 255"<br />
&nbsp;&nbsp;&nbsp; begin<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; clsg<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; show salle &amp; centre &amp; boule<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">ondrag</span> boule &amp; centre, <span style="color: rgb(240, 0, 0);">changement</span><br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while true : temporize<br />
<br />
fun changement<br />
&nbsp;&nbsp;&nbsp; begin<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if boule intersect centre : color@centre = "0 255 0"<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else color@centre = "255 0 0"<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return<br />
</div>
</div>
<span class=""></span><span class=""></span><span class=""></span><br />
D'autres types d'évènements peuvent être utilisés : <span style="font-style: italic;">souris entrante</span>, <span style="font-style: italic;">souris sortante</span>, <span style="font-style: italic;">clic souris</span>, <span style="font-style: italic;">double clic souris</span> et <span style="font-style: italic;">clic droit souris.</span><br style="font-style: italic;"><br />
<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(240, 240, 240);" class="" id="18"><font size="2"><span class="b"><strong>* <span style="text-decoration: underline;">Les prototypes</span><br />
</strong></span></font></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" class="" id="magicdomid9"><br />
</div>
<div style="text-align: justify;"><span class=""></span>Tels des legos, les prototypes sont des objets modifiables : on peut les enrichir pour y ajouter des nouveaux attributs et même, des <span style="font-style: italic;">méthodes fonctionnelles</span>.<br />
<br />
Dans l'exemple suivant, on associe la méthode fonctionnelle <span style="font-style: italic;">présentation</span> au prototype <span style="font-style: italic;">Marjordome</span>.<br />
<br />
<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(192, 192, 192);" class="" id="magicdomid50"><span class="i"><em></em></span>
  <div style="margin-left: 40px; text-align: left;">def Majordome<br />
&nbsp;&nbsp;&nbsp; prototypes<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; create marjordome &lt;&lt; <span style="font-weight: bold;">entity</span><br />
<br />
fun main<br />
&nbsp;&nbsp;&nbsp; messager :: marjordome<br />
&nbsp;&nbsp;&nbsp; nom :: string := "Jules"<br />
&nbsp;&nbsp;&nbsp; begin<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">assign </span>nom<span style="font-weight: bold;">,</span> messager<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">assign </span>présentation<span style="font-weight: bold;">,</span> messager<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print messager.présentation()<br />
<br />
fun présentation<br />
&nbsp;&nbsp;&nbsp; *this :: marjordome<br />
&nbsp;&nbsp;&nbsp; begin<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return "Je suis votre serviteur " + nom@this + "."&nbsp;&nbsp; <br />
</div>
</div>
<br />
<span class=""></span><span class=""></span><span class="">Et sur le tableau, s'affiche :<br />
<br />
</span><div style="text-align: center; background-color: rgb(240, 240, 240);"><span class="">Je suis votre serviteur Jules.</span><br />
<span class=""></span></div>
<span class=""></span><br />
<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(240, 240, 240);" class="" id="19"><font size="2"><span class="b"><strong>* <span style="text-decoration: underline;">Le clonage</span></strong></span></font><span class="b"><strong></strong></span></div>
<div style="font-family: courier new,courier,mono,monospace,serif;" class="" id="magicdomid9"><br />
</div>
<div style="text-align: justify;"><span class="">Parangon-lang supporte nativement le clonage (duplication d'un objet à l'identique). Celui-ci est effectué en préfixant la variable du symbole dièse</span> :<br />
</div>
<br />
<div style="font-family: courier new,courier,mono,monospace,serif; background-color: rgb(192, 192, 192);" class="" id="magicdomid50"><span class="i"><em></em></span>

  <div style="margin-left: 40px; text-align: left;">def L'attaque des clones<br />
&nbsp;&nbsp;&nbsp; prototypes<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; énergie :: number := 1000<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; create stormtrooper &lt;&lt; entity with énergie<br />
<br />
fun main<br />
&nbsp;&nbsp;&nbsp; prototype :: stormtrooper, énergie = 1000<br />
&nbsp;&nbsp;&nbsp; armée :: stormtrooper ..<br />
&nbsp;&nbsp;&nbsp; i :: number<br />
&nbsp;&nbsp;&nbsp; begin<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; assign attaquer, prototype<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*On clone le prototype 100 fois pour constituer notre armée :*/<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for 0 to 99 : <span style="font-weight: bold;">add <span style="color: rgb(240, 0, 0);">#</span>prototype, armée</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*àààà l'attaaaqueeee !*/<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for i, 0 to 99 : print "Le stormtrooper va effectuer une 
attaque de " + (armée[i].attaquer()) + " points !"<br />
<br />
fun attaquer<br />
&nbsp;&nbsp;&nbsp; *this :: stormtrooper<br />
&nbsp;&nbsp;&nbsp; begin<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return random(1000) + énergie@this<br />
</div>
</div>
<br />
<span class=""></span><span class=""></span><span class=""></span><span class="">Sur le tableau, s'affiche 100 fois :<br />
<br />
</span>
<div style="text-align: center; background-color: rgb(240, 240, 240);"><span class="">Le stormtrooper va effectuer une attaque de 1125 points !</span><br />
<span class=""></span></div>
<span class=""></span><br />
<br>
<hr style="width: 100%; height: 2px;"><br>
<br>
<div style="text-align: justify;"><font size="2">Vous avez découvert les
 premiers rudiments de la programmation avec le langage Parangon-Lang en <span
 style="font-weight: bold;">seulement dix minutes</span>. <br>
</font>
<font size="2">Ces premiers éléments sont suffisants pour écrire vos 
  premiers programmes. Si vous rencontrez quelques problèmes, n'hésitez pas à solliciter la communauté sur le <a href="http://groups.google.com/group/parangon-lang">forum</a>.<br>
<br>
</font>

</div>
</div>
<br>

</body></html>
